/**
 * Created by Administrator on 2017/3/21.
 */
import React, {Component,Fragment} from 'react';
import {Form, Button, Badge, Select, Switch, Divider,Descriptions,Input} from 'antd';
import {connect} from 'dva';
import moment from 'moment'
const { TextArea } = Input;
import {download,getFileType} from '@/utils/utils';
const ButtonGroup = Button.Group;
class AddPoliciesForm extends Component {
  constructor(props) {
    super(props);
    this.state = {
    };
  }

  componentDidMount() {
  }
  render() {

    const editRecord=this.props.editRecord;
    let status=''
    switch (editRecord.status) {
      case 1:
        status= <p className={`table-warm table-status`}>试用期</p>;
        break
      case 2:
        status=  <p className={`table-success table-status`}>在职</p>;
        break
      case 3:
        status=  <p className={`table-error table-status`}>离职</p>;
        break
    }
    return (
      <div>
        <Descriptions className={'blue-descriptions'} title={<div style={{textAlign:'center'}}>员工详情</div>} bordered>
          <Descriptions.Item label="真实姓名">{editRecord.name}</Descriptions.Item>
          <Descriptions.Item label="工号">{editRecord.job_number}</Descriptions.Item>
          <Descriptions.Item label="职位">{editRecord.position}</Descriptions.Item>
          <Descriptions.Item label="入职日期">{editRecord.entry_date}</Descriptions.Item>
          <Descriptions.Item label="入职部门">{editRecord.department_name}</Descriptions.Item>
          <Descriptions.Item label="手机号" >
            {editRecord.mobile}
          </Descriptions.Item>
          <Descriptions.Item label="身份证" >
            {editRecord.identity_number}
          </Descriptions.Item>
          <Descriptions.Item label="生日" >
            {editRecord.birthday}
          </Descriptions.Item>
          <Descriptions.Item label="邮箱" >
            {editRecord.email}
          </Descriptions.Item>
          <Descriptions.Item label="状态" >
            {status}
          </Descriptions.Item>
          <Descriptions.Item label="备注" >
            {editRecord.remark}
          </Descriptions.Item>
        </Descriptions>
        {
          editRecord.regularization_date&&
          <Fragment>
            <Divider style={{marginBottom:'10px'}}></Divider>
            <Descriptions className={'blue-descriptions'} title={<div style={{textAlign:'center'}}>转正详情</div>} bordered>
              <Descriptions.Item label="转正时间" >
                {editRecord.regularization_date}
              </Descriptions.Item>
              <Descriptions.Item label="转正备注" >
                {editRecord.regularization_remark}
              </Descriptions.Item>
            </Descriptions>
          </Fragment>
        }
        {
          editRecord.status===3&&
            <Fragment>
              <Divider style={{marginBottom:'10px'}}></Divider>
              <Descriptions className={'blue-descriptions'} column={4}  title={<div style={{textAlign:'center'}}>离职详情</div>} bordered>
                <Descriptions.Item label="离职时间" span={2}>
                 {editRecord.resignation_date}
                </Descriptions.Item>
                <Descriptions.Item label="离职原因" span={2}>
                  {editRecord.resignation_reason}
                </Descriptions.Item>
                <Descriptions.Item label="离职备注" span={4}>
                  {editRecord.resignation_remark}
                </Descriptions.Item>
              </Descriptions>
            </Fragment>
        }
        <p></p>
      </div>
    );
  }
}

const AddPoliciesFormWrap = Form.create()(AddPoliciesForm);
export default connect()(AddPoliciesFormWrap);


